﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Backup.ValueConverter
{
    using System.Windows.Data;

    public class Date2Bool : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            foreach (object o in values)
            {
                if (o==null)
                {
                    return false;
                }
            }
            
            return true;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            bool isChecked = (bool) value;
            if (!isChecked)
            {
                return new object[targetTypes.Length];
            }
            else
            {
                throw new NotSupportedException();
            }
        }
    }
}